package XueXi;

import java.util.Scanner;

public class For_For_xunhuanLX3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double sum = 0;//一个班总成绩
        double totalScore = 0;//累计所有人成绩
        int passNum = 0;//累计及格人数
        int classNum = 3;//班级个数
        int stuNum = 5;//班级人数
        for (int i = 1;i <=classNum;i++) {//班级
            for (int j = 1; j <= stuNum; j++) {//一个班级五个人
                System.out.println("请输入第"+i+"个班第" + j + "个学生成绩");
                double score = scanner.nextDouble();
                System.out.println("成绩为" + score);
                sum = sum + score;
                if (score>60){
                    totalScore++;
                }
            }
            System.out.println("本班总成绩为"+sum+"平均分为"+sum/stuNum);
            totalScore = totalScore + sum;
        }
        System.out.println("三个班级总分"+totalScore+"平均分"+totalScore/(classNum*stuNum));
        System.out.println("及格人数有"+passNum+"人");
    }
}
